# -*- coding: utf-8 -*-
###################################################
#    This file is part of blockIMH.
#
#    blockIMH is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    blockIMH is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with blockIMH.  If not, see <http://www.gnu.org/licenses/>.
###################################################
#! /usr/bin/env python

from __future__ import division

import subprocess

try:
    nbsim = 1000
    ps = [4, 48]
    for i, p in enumerate(ps):
        subprocess.call(["python", "launchProbit.py", "--p=%i" % p, "--nbsim=%i" % nbsim])
except:
    print "Error while launching the main program: is scipy.weave functional? try to launch 'python launch.py' \
            and see what is said."

try:
    subprocess.call(["R", "CMD", "BATCH", "--vanilla", "probitplots.R", "RB-out.out"])
except:
    print "Error while plotting: is R installed? And the ggplot2 library?"


